<%@ include file="/common/taglibs.jsp"%>

<head>
<title><fmt:message key="login.title" /></title>
<meta name="menu" content="Login" />
</head>
<body>

	<div class="span7">
		<form method="post" id="loginForm"
			action="<c:url value='/j_security_check'/>"
			onsubmit="saveUsername(this);return validateForm(this)"
			class="form-signin" autocomplete="off">
			<h2 class="form-signin-heading">
				<fmt:message key="login.heading" />
			</h2>
			<c:if test="${param.error != null}">
				<div class="alert alert-error fade in">
					<fmt:message key="errors.password.mismatch" />
				</div>
			</c:if>
			
			<c:if test="${param.captchaInvalid == true}">
				<div class="alert alert-error fade in">
					<fmt:message key="errors.captcha.invalid" />
				</div>
			</c:if>
			
			<input type="text" name="j_username" id="j_username"
				class="input-medinum"
				placeholder="<fmt:message key="label.username"/>" required>
			<input type="password" class="input-medinum" name="j_password"
				id="j_password" placeholder="<fmt:message key="label.password"/>"
				required>

			<div class="row-fluid">
				<div class="span6">
					<input type="text" name="captcha" required class="input-medium"
						placeholder="<fmt:message key="label.captcha"/>" />
				</div>
				<div class="span1"></div>

				<div class="span4">
					<img src="<c:url value='/getCaptcha'/>" id="Verify"
						style="cursor: pointer;" />
				</div>
			</div>

			<c:if test="${appConfig['rememberMeEnabled']}">
				<label class="checkbox" for="rememberMe"> <input
					type="checkbox" class="checkbox"
					name="_spring_security_remember_me" id="rememberMe" /> <fmt:message
						key="login.rememberMe" /></label>
			</c:if>

			<button type="submit" class="btn btn-primary" name="login">
				<fmt:message key='button.login' />
			</button>

			<a href='<c:url value="/signup"/>' class="btn btn-primary"><fmt:message
					key='button.register' /></a>
		</form>
	</div>

	<c:set var="scripts" scope="request">
		<%@ include file="/scripts/login.js"%>
	</c:set>

	<%-- <p><fmt:message key="login.passwordHint"/></p> --%>
</body>